import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'
import register from '../views/register.vue'

import index from '../views/Index.vue'
import home from '../views/home.vue'
import business from '../views/business.vue'
import businessPersonal from "../views/businessPersonal"
import password from "../views/password"
import category from "../views/category"
import goods from "../views/goods"
import banner from "../views/banner"
import admin from "../views/admin"
import user from "../views/user"
import order from "../views/order"
import comment from "../views/comment"
import collect from "../views/collect"

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView
  },
  {
    path: '/register',
    name: 'register',
    component: register
  },
  {
    path: '/index',
    name: 'index',
    component: index,
    redirect:"/home",
    children:[
      {
        path: '/home',
        name: 'homee',
        component: home,
        
      },{
        path: '/business',
        name: 'business',
        component: business,
        
      },{
        path: '/businessPersonal',
        name: 'businessPersonal',
        component: businessPersonal,
        
      },{
        path: '/password',
        name: 'password',
        component: password,
        
      },{
        path: '/category',
        name: 'category',
        component: category,
        
      },
    {
      path: '/goods',
      name: 'goods',
      component: goods,
      
    },
    {
      path: '/banner',
      name: 'banner',
      component: banner,
      
    },
    {
      path: '/order',
      name: 'order',
      component: order,
      
    },
    {
      path: '/comment',
      name: 'comment',
      component: comment,
      
    },
    {
      path: '/collect',
      name: 'collect',
      component: collect,
      
    },
    
    {
      path: '/admin',
      name: 'admin',
      component: admin,
      
    },
    {
      path: '/question',
      name: 'question',
      component: admin,
      
    },
    {
      path: '/user',
      name: 'user',
      component: user,
      
    }]
  },
  {
    path: '/about',
    name: 'about',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  }

]

const router = new VueRouter({
  routes
})

export default router
